package com.zt.jobs;

import com.zt.util.QiniuUtils;
import com.zt.util.RedisClient;
import com.zt.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Set;

@Component
public class ClearImgJob {

    @Autowired
    RedisClient redisClient;

    public void clearImgJob(){
        Set< Object > diff = redisClient.diff(Result.MSG_TAG,Result.DATA_TAG);

        for (Object s : diff) {
            QiniuUtils.deleteFileFromQiniu( s.toString() );
            redisClient.srem(Result.MSG_TAG,s);
            System.out.println("shanchule"+s);
        }
    }
}
